package com.lory;

import com.netflix.loadbalancer.RandomRule;
import feign.Logger;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
@EnableFeignClients
public class ServiceConsumerApplication {

    /**
     * NONE:不记录任何信息，默认值
     * BASIC:记录请求方法，请求URL，状态码和用时
     * HEADERS:在BASIC的基础上再记录一些常用信息
     * FULL:记录请求和相应的所有信息
     */
    @Bean
    public Logger.Level getLog(){
        return Logger.Level.FULL;
    }

    @Bean
    public RandomRule randomRule(){
        return new RandomRule();
    }

    public static void main(String[] args) {
        SpringApplication.run(ServiceConsumerApplication.class, args);
    }
}
